﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Name="FeatureStaplingFeatureRecipe"
xmlns="http://schemas.microsoft.com/pag/gax-core"
Bound="false">
  <DocumentationLinks>
    <Link Caption="Definition Schema" Url="http://msdn.microsoft.com/en-us/library/bb861862.aspx" Kind="Documentation"/>
  </DocumentationLinks>
 <Caption>Add Feature Stapling Feature</Caption>
    <HostData>
      <Icon File="spalm.ico" />
      <CommandBar Menu="SPALMSites"/>
    </HostData>
    <Arguments>
      <Argument Name="SolutionDefaultNameSpace">
        <ValueProvider Type="SteriaMummert.SharePoint.SoftwareFactoryLite.ValueProviders.DefaultNamespaceProvider, SteriaMummert.SharePoint.SoftwareFactoryLite" />
      </Argument>
      <Argument Name="SolutionAssemblyName">
        <ValueProvider Type="SteriaMummert.SharePoint.SoftwareFactoryLite.ValueProviders.AssemblyProvider, SteriaMummert.SharePoint.SoftwareFactoryLite" />
      </Argument>
      <Argument Name="TargetFolder">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="12\TEMPLATE\FEATURES\$(FeatureName)" />
      </Argument>
      <Argument Name="CurrentProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.FirstSelectedProject, Microsoft.Practices.RecipeFramework.Library" />
      </Argument>


      <Argument Name="TargetFeatureFile">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="feature.xml">
        </ValueProvider>
      </Argument>
      <Argument Name="FeatureID">
        <ValueProvider Type="SteriaMummert.SharePoint.SoftwareFactoryLite.ValueProviders.GuidValueProvider, SteriaMummert.SharePoint.SoftwareFactoryLite" />
      </Argument>
      <Argument Name="FeatureName">
        <Converter Type="Microsoft.Practices.RecipeFramework.Library.Converters.NamespaceStringConverter, Microsoft.Practices.RecipeFramework.Library" />
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="FeatureName" />
      </Argument>
      <Argument Name="FeatureTitle">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="Feature Title" />
      </Argument>
      <Argument Name="FeatureDescription" Required="false">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="Feature Description" />
      </Argument>
      <Argument Name="FeatureScope">
        <Converter Type="SteriaMummert.SharePoint.SoftwareFactoryLite.Converters.ScopeConverterWebPart, SteriaMummert.SharePoint.SoftwareFactoryLite" />
      </Argument>
      <Argument Name="FeatureHidden" Type="System.Boolean" />
      <Argument Name="FeatureVersion" Required="true">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="1.0.0.0" />
      </Argument>
      <Argument Name="FeatureCreateReceiver" Type="System.Boolean" />
      <Argument Name="FeatureReceiverClass">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="$(FeatureName)FeatureReceiver" >
          <MonitorArgument Name="FeatureName"/>
        </ValueProvider>
      </Argument>
      <Argument Name="FeatureCodeFolder">
        <ValueProvider Stage="OnBeforeActions" Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="CustomCode\$(FeatureName)" />
      </Argument>
      <Argument Name="FeatureReceiverFileName">
        <ValueProvider Stage="OnBeforeActions" Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="$(FeatureReceiverClass).cs" />
      </Argument>
      <Argument Name="FeatureActivationDependencies" Required="false" Type="SMC.SPALM.Types.FeatureActivationDependency[], SteriaMummert.SharePoint.SoftwareFactoryLite" >
        <ValueProvider ObjectType="SMC.SPALM.Types.FeatureActivationDependency" Type="SteriaMummert.SharePoint.SoftwareFactoryLite.ValueProviders.DefaultCollectionProvider, SteriaMummert.SharePoint.SoftwareFactoryLite"  />
      </Argument>
      <Argument Name="FeatureFiles" Required="false">
        <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" Expression="&lt;ElementFile Location='$(WebPartName).webpart' /&gt;" />
      </Argument>

      <Argument Name="FeatureAssociationsCollection" Required="false" Type="SMC.SPALM.Types.FeatureStapling[], SteriaMummert.SharePoint.SoftwareFactoryLite" />

    </Arguments>
    <GatheringServiceData>
      <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
        <Pages>
          <Page>
            <Title>Feature settings</Title>
            <Fields>
              <Field ValueName="FeatureID" Label="Feature ID" />
              <Field ValueName="FeatureName" Label="Name" />
              <Field ValueName="FeatureTitle" Label="Title" />
              <Field ValueName="FeatureDescription" Label="Description" />
              <Field ValueName="FeatureScope" Label="Scope" />
              <Field ValueName="FeatureHidden" Label="Hidden"></Field>
              <Field ValueName="FeatureVersion" Label="Version"></Field>
              <Field ValueName="FeatureCreateReceiver" Label="Create Feature Receiver" />
              <Field ValueName="FeatureActivationDependencies" Label="Activation Dependencies" >
                <Editor Type="SteriaMummert.SharePoint.SoftwareFactoryLite.Editors.CustomArrayEditor, SteriaMummert.SharePoint.SoftwareFactoryLite" />
              </Field>
            </Fields>
          </Page>
          <Page>
            <Title>Feature Associations</Title>
            <Fields>              
              <Field ValueName="FeatureAssociationsCollection" Label="Feature Associations" >
                <Editor Type="SteriaMummert.SharePoint.SoftwareFactoryLite.Editors.CustomArrayEditor, SteriaMummert.SharePoint.SoftwareFactoryLite" />
              </Field>
            </Fields>
          </Page>
        </Pages>
      </Wizard>
    </GatheringServiceData>

    <Actions  CoordinatorServiceType="Microsoft.Practices.RecipeFramework.Extensions.Coordinators.ConditionalCoordinator, Microsoft.Practices.RecipeFramework.Extensions">

      <Action Name="GenerateFeature" Template="Text\feature.xml.t4" Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library" InputValue="Configured Static Value">
        <Input Name="FeatureTitle" RecipeArgument="FeatureTitle" />
        <Input Name="FeatureDescription" RecipeArgument="FeatureDescription" />
        <Input Name="FeatureID" RecipeArgument="FeatureID" />
        <Input Name="FeatureHidden" RecipeArgument="FeatureHidden" />
        <Input Name="FeatureVersion" RecipeArgument="FeatureVersion" />
        <Input Name="FeatureScope" RecipeArgument="FeatureScope" />
        <Input Name="FeatureCreateReceiver" RecipeArgument="FeatureCreateReceiver" />
        <Input Name="FeatureCreateReceiverAssembly" RecipeArgument="SolutionAssemblyName" />
        <Input Name="FeatureReceiverNamespace" RecipeArgument="SolutionDefaultNameSpace" />
        <Input Name="FeatureCreateReceiverClass" RecipeArgument="FeatureReceiverClass" />
        <Input Name="FeatureActivationDependencies" RecipeArgument="FeatureActivationDependencies" />
        <Input Name="FeatureFiles" RecipeArgument="FeatureFiles" />
        <Output Name="Content" />
      </Action>
      <Action Name="AddFeature" Type="SteriaMummert.SharePoint.SoftwareFactoryLite.Actions.AddItemToFolderFromStringAction, SteriaMummert.SharePoint.SoftwareFactoryLite" Open="false">
        <Input Name="Content" ActionOutput="GenerateFeature.Content" />
        <Input Name="TargetFileName" RecipeArgument="TargetFeatureFile" />
        <Input Name="Project" RecipeArgument="CurrentProject" />
        <Input Name="TargetFolder" RecipeArgument="TargetFolder" />
      </Action>

      <Action Name="GenerateFeatureReceiver" Condition="$(FeatureCreateReceiver)" Template="Text\FeatureReceiver.cs.t4" Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library" InputValue="Configured Static Value">
        <Input Name="FeatureReceiverClass" RecipeArgument="FeatureReceiverClass" />
        <Input Name="FeatureReceiverNamespace" RecipeArgument="SolutionDefaultNameSpace" />
        <Output Name="Content" />
      </Action>
      <Action Name="AddFeatureReceiver" Condition="$(FeatureCreateReceiver)" Type="SteriaMummert.SharePoint.SoftwareFactoryLite.Actions.AddItemToFolderFromStringAction, SteriaMummert.SharePoint.SoftwareFactoryLite" Open="false">
        <Input Name="Content" ActionOutput="GenerateFeatureReceiver.Content" />
        <Input Name="TargetFileName" RecipeArgument="FeatureReceiverFileName" />
        <Input Name="Project" RecipeArgument="CurrentProject" />
        <Input Name="TargetFolder" RecipeArgument="FeatureCodeFolder" />
      </Action>


      <Action Name="GenerateElements" Template="Text\FeatureStapling\elements.xml.t4" Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library" InputValue="Configured Static Value">
        <Input Name="FeatureAssociationsCollection" RecipeArgument="FeatureAssociationsCollection" />
        <Output Name="Content" />
      </Action>
      <Action Name="AddElements" Type="SteriaMummert.SharePoint.SoftwareFactoryLite.Actions.AddItemToFolderFromStringAction, SteriaMummert.SharePoint.SoftwareFactoryLite" Open="true" TargetFileName="elements.xml">
        <Input Name="Content" ActionOutput="GenerateElements.Content" />
        <Input Name="Project" RecipeArgument="CurrentProject" />
        <Input Name="TargetFolder" RecipeArgument="TargetFolder" />
      </Action>
     
  </Actions>
</Recipe>